﻿using System.Configuration;
using System.Xml;

namespace FunctionalCLR.Shell {
    class TypeConfigSectionHandler : IConfigurationSectionHandler {
        public virtual object Create(
            object parent, object configContext, XmlNode section) {
            string name = "";
            string assemblyName = "";
            string typeName = "";

            SectionHelper.GetStringValue(section, "name", ref name);
            SectionHelper.GetStringValue(section, "assembly", ref assemblyName);
            SectionHelper.GetStringValue(section, "type", ref typeName);

            return new TypeConfigSection(name, assemblyName, typeName);
        }
    }
}
